package com.mz.mattress.api.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 优惠券 发放类型 1注册赠送  2自动发放 3商家审核通过
 */
public enum CouponSendTypeEnum {

    NEW_REGISTER(1, "新用户注册赠送"),
    AUTO_SEND(2, "自动发放"),
    MERCHANT_CHECK_PASS(3, "商家审核通过"),
    ;

    private Integer value;

    private String desc;

    CouponSendTypeEnum(final Integer value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    private static Map<Integer, CouponSendTypeEnum> map = new HashMap<>();

    static {
        for (CouponSendTypeEnum stepEnum : CouponSendTypeEnum.values()) {
            map.put(stepEnum.value, stepEnum);
        }
    }

    public static CouponSendTypeEnum valueOf(int value) {
        return map.get(value);
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }
}
